#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time: 2022/9/30 19:10
# @Author: 徐洪英
# @Email: xx@gmail.com
# @File：run.py
import time
import unittest
from BeautifulReport import BeautifulReport
from config.config import CASE_PATH, REPORT_PATH
from tools.tools import gen_case

gen_case() # 生成用例
suite = unittest.defaultTestLoader.discover(CASE_PATH, pattern='test_*.py')
now = time.strftime('%Y%m%d%H%M%S')
filename = 'interface_test_result_{}.html'.format(now)
BeautifulReport(suite).report(description='接口测试',
                              report_dir=REPORT_PATH,
                              filename=filename)